package 语雀题目21至55;

/**
 * ClassName: 按每行五个输出前二十个递推数列
 * Package: 语雀21至40
 * Description:
 *
 * @Author fjorid
 * @Create 2025/1/6 18:55
 * @Version 1.0
 */
public class 按每行五个输出前二十个递推数列23 {
    public static void main(String[] args) {
        int first = 2,second = 3,next = first+second;
        System.out.print(" "+first+" "+second);
        int count=2;
        for (int i = 1; i <=18 ; i++) {
            System.out.print(" "+next);
            first = second;
            second = next;
            count++;
            next = first + second;
            if(count%5==0){
                System.out.println("");
         }
        }
    }
}
